package org.ymf.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ChartType {

    K_LINE("k", "折线图"),
    HISTOGRAM("h", "柱状图"),
    PIE("p","饼状图");

    private String type;
    private String name;

    public static String getNameByType(String type) {
        ChartType [] enums = values();
        for (ChartType e : enums) {
            if (e.getType().equals(type)) {
                return e.getName();
            }
        }
        return null;
    }

}
